feat: add buildPaymentMemo and parsePaymentMemo helpers - #707
Open
Olisachukwuma1 wants to merge 1 commit into
Open
feat: add buildPaymentMemo and parsePaymentMemo helpers#707Olisachukwuma1 wants to merge 1 commit into
Olisachukwuma1 wants to merge 1 commit into
Conversation
- buildPaymentMemo(invoiceId, opts?) builds split:{id} or split:{id}:t{tranche}
memos, truncated to 28 bytes at a valid UTF-8 character boundary
- parsePaymentMemo(memo) parses both formats; returns null for non-split memos
- Both exported from src/memoBuilder.ts and re-exported from src/index.ts
- 14 unit tests covering base format, tranche, truncation (ASCII + multi-byte),
round-trips, null returns, and truncation edge cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds canonical memo helpers for Stellar invoice payment transactions, replacing ad-hoc memo string construction across callers.
ull\ for non-split memos
Tests
14 unit tests in \ est/memoBuilder.test.ts\ covering base format, tranche format, ASCII and multi-byte truncation, round-trips, null returns, and truncation edge cases.
closes #610